<script lang="ts" setup>
  import { Col, Row } from '@sscd/grid';
</script>

<template>
  <div class="demo">
    <div class="demo-title">对齐</div>
    <div class="demo-content">
      <p>Align Top</p>
      <Row class="row" type="flex" justify="center" align="top">
        <Col class="col odd" :span="4">
          <p class="height-100">col-4</p>
        </Col>
        <Col class="col even" :span="4">
          <p class="height-50">col-4</p>
        </Col>
        <Col class="col odd" :span="4">
          <p class="height-120">col-4</p>
        </Col>
        <Col class="col even" :span="4">
          <p class="height-80">col-4</p>
        </Col>
      </Row>
      <p>Align Center</p>
      <Row class="row" type="flex" justify="space-around" align="middle">
        <Col class="col odd" :span="4">
          <p class="height-100">col-4</p>
        </Col>
        <Col class="col even" :span="4">
          <p class="height-50">col-4</p>
        </Col>
        <Col class="col odd" :span="4">
          <p class="height-120">col-4</p>
        </Col>
        <Col class="col even" :span="4">
          <p class="height-80">col-4</p>
        </Col>
      </Row>
      <p>Align Bottom</p>
      <Row class="row" type="flex" justify="space-between" align="bottom">
        <Col class="col odd" :span="4">
          <p class="height-100">col-4</p>
        </Col>
        <Col class="col even" :span="4">
          <p class="height-50">col-4</p>
        </Col>
        <Col class="col odd" :span="4">
          <p class="height-120">col-4</p>
        </Col>
        <Col class="col even" :span="4">
          <p class="height-80">col-4</p>
        </Col>
      </Row>
    </div>
  </div>
</template>

<style lang="less" scoped>
  .demo {
    :deep(.row) {
      margin-bottom: 12px;
      .col {
        padding: 16px 0;
        text-align: center;
        color: #fff;
        &.odd {
          background: rgba(0, 146, 255, 0.75);
        }
        &.even {
          background: #0092ff;
        }
        .height-50 {
          height: 50px;
          line-height: 50px;
        }
        .height-100 {
          height: 100px;
          line-height: 100px;
        }
        .height-120 {
          height: 120px;
          line-height: 120px;
        }
      }
    }
  }
</style>
